<div class="row compare-tab" id="comapre_div_id" style="display:<?php echo $display; ?>">
    <div class="compare-element">
        <?php
        $form = $this->beginWidget('GxActiveForm', array(
            'id' => 'compare-form',
            'action' => Yii::app()->createUrl('compare/view'),
        ));
        ?>
        <div class="container">
            <div class="col-lg-12 col-sm-12 col-md-12">
                <div class="row" id="cart_comapre">
                    <div class="cartcomapretext">
                        <?php
                        if ($display == "") {
                            for ($i = 0; $i < count($compareIds); $i++) {
                                ?>
                                <?php
                                $classcoursedata = explode("@", $compareIds[$i]);
                                if ($classcoursedata[1] == "class") {
                                    $classcoursetype = $classcoursedata[1];
                                    $classcourseDetail = Classes::model()->findByPk($classcoursedata[0]);
                                    $class_course_titile = $classcourseDetail->class_titile;
                                    $imagePath = ($classcourseDetail->users_id == '') ? 'backend/' . $classcourseDetail->backend_user_id : $classcourseDetail->users_id;
                                    $imagePath = getImagePathByClassCourse('Classes', $classcoursedata[0]);
                                    $imageName = (ClassImage::getPrimaryImage($classcoursedata[0]) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . 'thumbs/' . ClassImage::getPrimaryImage($classcoursedata[0]) : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                                } else {
                                    /* This is for course */
                                    $classcoursetype = $classcoursedata[1];
                                    $classcourseDetail = Courses::model()->findByPk($classcoursedata[0]);
                                    $class_course_titile = $classcourseDetail->course_titile;
                                    $imagePath = getImagePathByClassCourse('Courses', $classcoursedata[0]);
                                    $imageName = (ClassImage::getCoursesPrimaryImage($classcoursedata[0]) != '') ? getRequestbaseUrl() . getuploadFolderDir() . SkillConfig::getClassCourseImagePath($imagePath) . 'thumbs/' . ClassImage::getCoursesPrimaryImage($classcoursedata[0]) : getWorkNoshopimage(SkillConfig::skill_myinbox_image);
                                }

                                $classcourseImg = '<img src="' . $imageName . '" height="70" width="70"  alt="' . $class_course_titile . '">';
                                ?>

                                <div class="compare-division">
                                    <input type="hidden" class="compareids" name="class_course_id[]" value="<?php echo $compareIds[$i]; ?>" />
                                    <div class="thumbnail">
                                        <?php echo $classcourseImg; ?>
                                        <span><?php echo substr($class_course_titile, 0, 20); ?></span>
                                    </div>
                                    <a href="javascript:void(0)" onclick="RemoveCompareList('<?php echo $classcoursedata[0]; ?>', '<?php echo $classcoursetype; ?>');" class="xlose-button"></a>
                                </div>   <?php
                            }
                        }
                        ?>
                    </div>

                    <div class="compare-division">
                        <p>You can add only upto 4 classes to compare.</p>
                        <div class="clearfix"></div>
                        <span id="copareloader" style="display:none;"><img src="<?php echo ThemePath(); ?>/images/sitciyloder.gif"></img></span><?php echo GxHtml::submitButton(Yii::t('app', 'Compare'), array('onClick' => 'return CheckComparedata();', 'class' => 'compare-btn1')); ?>
                    </div>
                </div>
            </div>
        </div>
        <?php
        $this->endWidget();
        ?>
    </div>
</div>
<div class="clearfix"></div>
<script type="text/javascript">
    function CheckComparedata() {
        var allClasses = ($('.compareids').size());
        if (allClasses < 2) {
            bootbox.confirm("You need minimum 2 workshops/courses to be able to compare.", function(result) {

            })
            return false;
        } else {
            return true;
        }

    }

</script>


